import request from '@/config/axios'

// 供应商账户 VO
export interface SupplierAccountVO {
  id: number // id
  supplierId: number // 供应商ID
  rmbRecipient: string // 收款人
  rmbBankOpen: string // 开户行
  rmbRecvAddress: string // 收款人地址
  rmbBankNo: string // 银行账号
  rmbContactPhone: string // 联系电话
  rmbBankOpenAddr: string // 开户行网点
  dollarBeneficiary: string // 受益人
  dollarBankOpen: string // 开户行
  dollarBankNo: string // 银行账号
  dollarBankOpenAddr: string // 开户行网点
  dollarContactPhone: string // 联系电话
  dollarSwiftNo: string // SWIFT/BIN NO
  remark: string // 备注
}

// 供应商账户 API
export const SupplierAccountApi = {
  // 查询供应商账户分页
  getSupplierAccountPage: async (params: any) => {
    return await request.get({ url: `/business/supplier-account/page`, params })
  },

  // 查询供应商账户详情
  getSupplierAccount: async (id: number) => {
    return await request.get({ url: `/business/supplier-account/get?id=` + id })
  },

  // 新增供应商账户
  createSupplierAccount: async (data: SupplierAccountVO) => {
    return await request.post({ url: `/business/supplier-account/create`, data })
  },

  // 修改供应商账户
  updateSupplierAccount: async (data: SupplierAccountVO) => {
    return await request.put({ url: `/business/supplier-account/update`, data })
  },

  // 删除供应商账户
  deleteSupplierAccount: async (id: number) => {
    return await request.delete({ url: `/business/supplier-account/delete?id=` + id })
  },

  // 导出供应商账户 Excel
  exportSupplierAccount: async (params) => {
    return await request.download({ url: `/business/supplier-account/export-excel`, params })
  },
}